<?php
require_once("globalisempty.php");
#[会员登录页]
require_once("global.php");

$navid="newproducts";
$langs["msg_emptyid"]=$langs["msg_emptyid".$bi];
if($act == "loginok")
{
	$username = SafeHtml($username);
	$password = SafeHtml($password);

	$langs["msg_emptyid"]=$langs["msg_emptyid".$bi];
	if(!$username)
	{
		$langs["tip"]=$langs["tip".$bi];
		Error($langs["empty_user".$bi],"login.php");
	}
	if(!$password)
	{
		$langs["tip"]=$langs["tip".$bi];
		Error($langs["empty_pass".$bi],"login.php");
	}

	$rs = $DB->qgGetOne("SELECT id,user,pass,email,state,levelid FROM ".$prefix."user WHERE user='".$username."' and state ='1'  AND pass='".md5($password)."'");
	if(!$rs)
	{
		Error($langs["notuser".$bi],"login.php");
	}
	$_SESSION["qg_sys_user"] = $rs;
	//echo $_SESSION["qg_sys_user"]["user"];
	$langs["msg_emptyid"]=$langs["msg_emptyid".$bi];
	#[指定跳转页]
	if($_SESSION["qg_sys_user"]["user"]=="ha")Error("","products.php?id=17");
	if($_SESSION["qg_sys_user"]["user"]=="lt")Error("","products.php?id=19");
	if($_SESSION["qg_sys_user"]["user"]=="ft")Error("","products.php?id=20");
	$langs["msg_emptyid"]=$langs["msg_emptyid".$bi];
	Error($langs["userloginok".$bi],"newproducts.php");

}
elseif($act == "logout")
{
	$_SESSION["qg_sys_user"] = "";
	$langs["msg_emptyid"]=$langs["msg_emptyid".$bi];
	Error($langs["userlogoutok".$bi],"newproducts.php");
	qgheader();
}
else
{

	#[标题头]
	$sitetitle = $langs["logintitle".$bi]." - ".$system["sitename".$bi];
	#[向导栏]
	$lead_menu[0]["url"] = $siteurl."login.php";
	$lead_menu[0]["name"] = $langs["logintitle".$bi];

	
	$langs["logintitle"]=$langs["logintitle".$bi];
	$langs["no_member"] = $langs["no_member".$bi];
	$langs["member_login"] = $langs["member_login".$bi];
	$langs["username"] = $langs["username".$bi];
	$langs["password"] = $langs["password".$bi];
	$langs["purview"] = $langs["purview".$bi];
	$langs["reset"] = $langs["reset".$bi];
	$langs["submit"] = $langs["submit".$bi];
	$langs["reg_emptyuser"] = $langs["reg_emptyuser".$bi];
	$langs["reg_emptypass"] = $langs["reg_emptypass".$bi];
	
	FOOT("login");
}
?>